
#include "stdafx.h"
#include <vector>
#include "..\NPythonBind\NPythonBind.h"

class MyClass : public NObject
{
public:
	MyClass()	{}
	virtual ~MyClass()	{}

	int helloNoArg()
	{
		return 120;
	}

	int hello1Arg(int a)
	{
		return a+1;
	}

public:
	static void exportClass(void);
	static NClassBase* getClass(void)	{	return &m_classMyClass; }
	static NClass<MyClass, NObject>	m_classMyClass;
};

NClass<MyClass, NObject> MyClass::m_classMyClass("MyClass");

void MyClass::exportClass(void)
{
	m_classMyClass.addMethodDef(makeMethodDef<0>(&MyClass::helloNoArg, "helloNoArg", "helloNoArg doc"));
	m_classMyClass.addMethodDef(makeMethodDef<1>(&MyClass::hello1Arg, "hello1Arg", "hello1Arg doc"));
}

static PyMethodDef MyPythonExMethods[2] =
{
	{NULL}, {NULL}
};

PyMODINIT_FUNC initFirstModule(void)
{
	MyPythonExMethods[0] = makeMethodDef<100>(&MyClass::hello1Arg, "GHello1Arg", "hello1Arg doc");
	PyObject* pModule = Py_InitModule("FirstModule", MyPythonExMethods);

	NObject::m_classNObject.exportToMoudle(pModule);
	MyClass::m_classMyClass.exportToMoudle(pModule);
}